<template>
	<view id="domxee-content" :class="globalData.defaultThemes">
		<view id="header_wrapper">
			<nii-navbar :globalData="globalData" :scroll="scroll" back>
				<!-- <view slot="back"></view> -->
				<view slot="title">
					<view id="title" class="fw-bolder">{{renders.main_title}}</view>
				</view>
				<!-- <view slot="tools"></view> -->
			</nii-navbar>
		</view>
		<view id="content_wrapper" class="w-100">
			<image :src="renders.image_url" mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				globalData: {windowWidth: 0, statusBarHeight: 0, navHeight: 0, navigationBarHeight: 0, wechatCapsule: {width: 0, height: 0, top: 0, right: 0, bottom: 0, left: 0}, defaultThemes: [], colors: {}, configs: {} },
				scroll: 0,
				current_page: {route: '', params: {}, url: ''},
				ready: false,
				options: {
				
				},
				styles: {
					header_wrapper: ''
				},
				
				shows: {
					agreements: false,
				
				
					questions: false,
					bind: false,
				},
				renders: {
					main_title: "",
					info: {
						phone: "",
						avatar: "",
						invite_code: ""
					},
					wallet: {
						enable: true,
						title: "",
						contents: [
							
						]
					},
					orders: {
						enable: true,
						title: "我的订单",
						sub_title: {
							name: "查看全部",
							alias: ""
						}
					},
					banner: {
						enable: true,
						title: "中间广告图",
						logo: ""
					},
					service: {
						enable: true,
						title: "",
						contents: [
							{
								alias: "",
								params: [],
								name: "",
								logo: "",
								class: ""
							}
						]
					},
					
					
					background: '',
					search_keyword: '加载中',
					banners: [],
					navigations: [					],
					arrondi: {enable: false, alias: 'none', params: {}, img: ''},
					topic: {enable: false, alias: 'none', params: {}, img: ''},
					weeks: {enable: false, title: '每周上新', tip: '优选好物，应有尽有', lists: []},
					lists: {
						mode: 'default',
						categories: [
							{query_params: {}, name: '猜你喜欢', desc: '精选好物', mode: 'default'},
						],
					}
				},
				data: {
					formData: {
						username: '',
						password: '',
						
						
						// invite_code: '',
						// mobile: '',
						// code: '',
						// bind_mobile: '',
						// bind_code: '',
						// oauth: {}
					},
					sections: {
						current: 0,
						
						
						
						
						is_agreement: false,
				
				
				
						redirect_uri: '',
						inviter: {
							id: 0,
							avatar: '',
							nickname: '',
							invite_code: '',
							mobile: ''
						},
						login_show: 'mobile',
						mobile_login: {
							verify_seconds: 0,
							button_active: false,
							verify_active: false,
						},
						bind: {
							verify_seconds: 0,
							button_active: false,
							verify_active: false,
						},
						password_login: {
							button_active: false
						}
					}
				},
			}
		},
		onLoad(options) { //页面加载时操作（options可获取当前页面传递参数，如：options.id）
			//设置对象
			let that = this;
			//设置当前页面数据
			that.current_page = that.nii_common.pages.getCurrentUrl();
			// //设置默认数据
			that.globalData = that.nii_common.pages.initGlobalData(getApp().globalData);
			// //设置参数
			// that.options = options;
			//初始数据
			that.initInformation();
		},
		methods: {
			//默认跳转操作
			navigateAction: function(alias, requestParams = {}, action = 'navigate', authenticate = false, animationType = 'slide-in-right') {
				//设置对象
				let that = this;
				if(alias == ''){
					that.nii_common.toastAlert('即将开放');
				}else{
					//跳转页面
					that.nii_common.navigate.action(alias, requestParams, action, authenticate, animationType);
				}
			},
			initInformation: function(refresh = false) {
				const systemInfo = uni.getSystemInfoSync();
				console.log(systemInfo);
				//设置对象
				let that = this;
				var platform = systemInfo.uniPlatform;
				//loading
				!that.ready && that.nii_common.toastLoading('请稍候');
				// 获取初始数据
				that.nii_common.request.build('user/invite_information', {platform}, 'POST', function(res) {
					//设置信息
					that.renders = res.data;
					//设置准备已就绪
					that.ready = true;
					//停止刷新
					refresh && uni.stopPullDownRefresh();
					//设置分类触发
					// that.changeCategory(0);
				}, function(res) {
					//提示失败
					that.nii_common.toastAlert(res.msg);
				}, function() {
					//隐藏loading
					that.nii_common.toastLoadingHide();
				}, true);
			},
			makePhoneCall() {
				uni.makePhoneCall({
					phoneNumber: '08162208799'
				});
			}
		}
	}
</script>

<style>
	page{
		background: rgba(247, 247, 247, 1);
	}
</style>
